Goal:

Questions:

What does it mean to be correlated? Bob made some sugestions for the caculation of phenotype and the slope of the interaction. prob_of_survive = 1.0/(1+exp(-((compair_pheno-c)/w))) In this equation c=0 and w=10. W may be too high, which could limit interaction/coevolution outcomes. The way phenotypes are defined might be creating a multiplicative effect: exp(ind.sumOfMutationsOfType(m2)/10))

Background

Experiment

I created a simulation study to observe the co-evolutionary outcome of the newt-snake interaction with different genetic architectures (GAs) in a spatial setting. I hypothesized that we would see an interaction (co-evolutionary arms race) between newt and snake phenotype under some GA combinations when newts and snakes were evolving over geographical space. Each GA is paired with another GA creating 16 combinations.

GA1 experiment values:

Each GA combination and trial has its own msprime simulation. I ran 3 experiments a) no exp in the phenotype, b) lower w and, c) both no exp and a lower w

The data

many of the experiments did not run to completion (i will run this part 3 times)

## All cor, lit, and grid files exist!
## This program will now end!
## All cor, lit, and grid files exist!
## This program will now end!
## All cor, lit, and grid files exist!
## This program will now end!

Mean Phenotype Whole Simulation

Phenotype differences (both_lower_w_no_exp)

Table of average Differences (both_lower_w_no_exp)

##                    Group.1           x
## 1  1e-08_0.005_1e-08_0.005 -1.51426587
## 2   1e-08_0.005_1e-09_0.05 -2.46502318
## 3    1e-08_0.005_1e-10_0.5 -2.95261240
## 4      1e-08_0.005_1e-11_5 -1.20777647
## 5   1e-09_0.05_1e-08_0.005 -0.21336817
## 6    1e-09_0.05_1e-09_0.05 -1.19346049
## 7     1e-09_0.05_1e-10_0.5 -1.35969385
## 8       1e-09_0.05_1e-11_5 -1.06953203
## 9    1e-10_0.5_1e-08_0.005 -0.16383653
## 10    1e-10_0.5_1e-09_0.05 -0.27008539
## 11     1e-10_0.5_1e-10_0.5 -0.03165683
## 12       1e-10_0.5_1e-11_5  0.40039860
## 13     1e-11_5_1e-08_0.005 -0.46647760
## 14      1e-11_5_1e-09_0.05 -0.31799699
## 15       1e-11_5_1e-10_0.5  0.55002347
## 16         1e-11_5_1e-11_5  1.69392449

Phenotype differences (lower_w)

Table of average Differences (lower_w)

##                    Group.1           x
## 1  1e-08_0.005_1e-08_0.005 -0.07560489
## 2   1e-08_0.005_1e-09_0.05 -0.45206573
## 3    1e-08_0.005_1e-10_0.5 -0.93236044
## 4      1e-08_0.005_1e-11_5 -1.34750726
## 5   1e-09_0.05_1e-08_0.005  0.29741783
## 6    1e-09_0.05_1e-09_0.05 -0.41278289
## 7     1e-09_0.05_1e-10_0.5 -0.27036120
## 8       1e-09_0.05_1e-11_5  0.70687010
## 9    1e-10_0.5_1e-08_0.005  1.57745179
## 10    1e-10_0.5_1e-09_0.05 -0.94392931
## 11     1e-10_0.5_1e-10_0.5 -0.50809115
## 12       1e-10_0.5_1e-11_5 -0.63724476
## 13     1e-11_5_1e-08_0.005  1.17201401
## 14      1e-11_5_1e-09_0.05 -1.26567646
## 15       1e-11_5_1e-10_0.5 -0.42440551
## 16         1e-11_5_1e-11_5 -0.65839029

Phenotype differences (no_exp)

Table of average Differences (no_exp)

##                    Group.1          x
## 1  1e-08_0.005_1e-08_0.005 -4.1473108
## 2   1e-08_0.005_1e-09_0.05 -4.4691855
## 3    1e-08_0.005_1e-10_0.5 -4.7064956
## 4      1e-08_0.005_1e-11_5 -4.8079958
## 5   1e-09_0.05_1e-08_0.005 -3.0306376
## 6    1e-09_0.05_1e-09_0.05 -3.8945754
## 7     1e-09_0.05_1e-10_0.5 -4.2043963
## 8       1e-09_0.05_1e-11_5 -4.3995742
## 9    1e-10_0.5_1e-08_0.005 -0.2254921
## 10    1e-10_0.5_1e-09_0.05 -1.3878429
## 11     1e-10_0.5_1e-10_0.5 -2.0643520
## 12       1e-10_0.5_1e-11_5 -2.0162477
## 13     1e-11_5_1e-08_0.005  0.7723211
## 14      1e-11_5_1e-09_0.05 -0.5933950
## 15       1e-11_5_1e-10_0.5 -1.0389160
## 16         1e-11_5_1e-11_5 -2.0689460

Connection between higher phenotype and population

Phenotype differences (both_lower_w_no_exp)

Phenotype & Populationsize differences (both_lower_w_no_exp)

Phenotype differences (lower_w)

Phenotype & Populationsize differences (lower_w)

Phenotype differences (no_exp)

Phenotype & Populationsize differences (no_exp)

Correlation

HEREREERERERER

cor (both_lower_w_no_exp)

cor (lower_w)

cor (no_exp)

Correlation Histograms Both

Plot 1

Plot 2

Plot 3

Plot 4

Plot 5

Plot 6

Plot 7

Plot 8

Plot 9

Plot 10

Correlation Histograms Lower w

Plot 1

Plot 2

Plot 3

Plot 4

Plot 5

Plot 6

Plot 7

Plot 8

Plot 9

Plot 10

Correlation Histograms no exp

Plot 1

Plot 2

Plot 3

Plot 4

Plot 5

Plot 6

Plot 7

Plot 8

Plot 9

Plot 10

Correlation across time (both_lower_w_no_exp)

Random 1 (both_lower_w_no_exp)

## [1] "pattern 1e-10_0.5_1e-10_0.5_3"
## [1] "Cor between average snake pheno and local cor -0.0509598684052669"
## [1] "Cor between average newt pheno and local cor -0.0616088122733205"
## [1] "Cor between average dif pheno and local cor 0.024753510228788"
## [1] "Cor between newt pheno and snake 0.452967125117761"

Random 2 (both_lower_w_no_exp)

## [1] "pattern 1e-09_0.05_1e-08_0.005_0"
## [1] "Cor between average snake pheno and local cor NA"
## [1] "Cor between average newt pheno and local cor NA"
## [1] "Cor between average dif pheno and local cor NA"
## [1] "Cor between newt pheno and snake 0.857207147586658"

Random 3 (both_lower_w_no_exp)

## [1] "pattern 1e-09_0.05_1e-10_0.5_2"
## [1] "Cor between average snake pheno and local cor NA"
## [1] "Cor between average newt pheno and local cor NA"
## [1] "Cor between average dif pheno and local cor NA"
## [1] "Cor between newt pheno and snake 0.845226168052167"

Correlation across time (lower_w)

Random 1 (lower_w)

## [1] "pattern 1e-08_0.005_1e-08_0.005_3"
## [1] "Cor between average snake pheno and local cor -0.239884385890239"
## [1] "Cor between average newt pheno and local cor -0.224294577594795"
## [1] "Cor between average dif pheno and local cor -0.380489332922223"
## [1] "Cor between newt pheno and snake 0.998670614771072"

Random 2 (lower_w)

## [1] "pattern 1e-10_0.5_1e-08_0.005_1"
## [1] "Cor between average snake pheno and local cor NA"
## [1] "Cor between average newt pheno and local cor NA"
## [1] "Cor between average dif pheno and local cor NA"
## [1] "Cor between newt pheno and snake 0.340665480109894"

Random 3 (lower_w)

## [1] "pattern 1e-11_5_1e-09_0.05_2"
## [1] "Cor between average snake pheno and local cor -0.170477954353067"
## [1] "Cor between average newt pheno and local cor -0.258054361352234"
## [1] "Cor between average dif pheno and local cor 0.292227184956155"
## [1] "Cor between newt pheno and snake 0.90110923231345"

Correlation across time (no_exp)

Random 1 (no_exp)

## [1] "pattern 1e-10_0.5_1e-11_5_2"
## [1] "Cor between average snake pheno and local cor -0.00510092147501471"
## [1] "Cor between average newt pheno and local cor 0.0845087520427481"
## [1] "Cor between average dif pheno and local cor -0.0741149559013315"
## [1] "Cor between newt pheno and snake 0.850957045510594"

Random 2 (no_exp)

## [1] "pattern 1e-10_0.5_1e-11_5_3"
## [1] "Cor between average snake pheno and local cor -0.00639271957395647"
## [1] "Cor between average newt pheno and local cor -0.100219392868776"
## [1] "Cor between average dif pheno and local cor 0.066755299995335"
## [1] "Cor between newt pheno and snake 0.691152279038801"

Random 3 (no_exp)

## [1] "pattern 1e-10_0.5_1e-10_0.5_2"
## [1] "Cor between average snake pheno and local cor -0.119820551416607"
## [1] "Cor between average newt pheno and local cor -0.112544845130158"
## [1] "Cor between average dif pheno and local cor -0.103077399834705"
## [1] "Cor between newt pheno and snake 0.891358848348999"

What happens over time (looking at the beginning, middle, and late part of my simulations) (both_lower_w_no_exp)

Pheno Beginning (both_lower_w_no_exp)

Pheno Middle (both_lower_w_no_exp)

Pheno End (both_lower_w_no_exp)

Dif Beginning (both_lower_w_no_exp)

Dif Middle (both_lower_w_no_exp)

Dif End (both_lower_w_no_exp)

What happens over time (looking at the beginning, middle, and late part of my simulations) (lower_w)

Pheno Beginning (lower_w)

Pheno Middle (lower_w)

Pheno End (lower_w)

Dif Beginning (lower_w)

Dif Middle (lower_w)

Dif End (lower_w)

What happens over time (looking at the beginning, middle, and late part of my simulations) (no_exp)

Pheno Beginning (no_exp)

Pheno Middle (no_exp)

Pheno End (no_exp)

Dif Beginning (no_exp)

Dif Middle (no_exp)

Dif End (no_exp)

Summary (both_lower_w_no_exp)

Early-Sim Population Size Summary

Mid-Sim Population Size Summary

Late-Sim Population Size Summary

Early Difference Summary

Mid Difference Summary

Late Difference Summary

By Snake GA (Early)

By Snake GA (Mid)

By Snake GA (Late)

By Newt GA (Early)

By Newt GA (Mid)

By Newt GA (Late)

Summary (lower_w)

Early-Sim Population Size Summary

Mid-Sim Population Size Summary

Late-Sim Population Size Summary

Early Difference Summary

Mid Difference Summary

Late Difference Summary

By Snake GA (Early)

By Snake GA (Mid)

By Snake GA (Late)

By Newt GA (Early)

By Newt GA (Mid)

By Newt GA (Late)

Summary (no_exp)

Early-Sim Population Size Summary

Mid-Sim Population Size Summary

Late-Sim Population Size Summary

Early Difference Summary

Mid Difference Summary

Late Difference Summary

By Snake GA (Early)

By Snake GA (Mid)

By Snake GA (Late)

By Newt GA (Early)

By Newt GA (Mid)

By Newt GA (Late)

Heatmap (both_lower_w_no_exp)

Population Size (Early)

Population Size (Mid)

Population Size (Late)

Phenotype (Early)

Phenotype (Mid)

Phenotype (Late)

Heatmap (lower_w)

Population Size (Early)

Population Size (Mid)

Population Size (Late)

Phenotype (Early)

Phenotype (Mid)

Phenotype (Late)

Heatmap (no_exp)

Population Size (Early)

Population Size (Mid)

Population Size (Late)

Phenotype (Early)

Phenotype (Mid)

Phenotype (Late)